package net.hn.hnms.biz.project.enums;

/**
 * @author 刘昊
 * @date 2024-03-12 16:00
 */
public enum QualityFileType {
    TYPE_1("1", "检查记录附件"),
    TYPE_2("2", "问题整改附件"),
    TYPE_3("3", "质量报告附件");

    private final String value;
    private final String description;

    QualityFileType(String value, String description) {
        this.value = value;
        this.description = description;
    }

    public String getValue() {
        return value;
    }

    public String getDescription() {
        return description;
    }

    public static QualityFileType getFileTypeByValue(String value) {
        for (QualityFileType fileType : QualityFileType.values()) {
            if (fileType.getValue().equals(value)) {
                return fileType;
            }
        }
        throw new IllegalArgumentException("No matching file type for value: " + value);
    }
}
